Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to allow digest algorithm patching. #229

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

midnight-wonderer
Copy link

Hi,
I once tried to discuss the default digest length on #169, to no avail.
How about simply refactoring things around without behavioral changes?

I extracted

Digest::SHA1.hexdigest(text).first(8)

into a private method, allowing a stable way for monkey-patching without affecting the functionality.

This keeps the current algorithm and output length, the change is minimal, and no change to any of the existing tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant